package cn.avalon.controller;

import cn.avalon.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: Avalon
 * @date: 2022年09月21日 ： 11:12
 * @version: ver1.0
 * @email 709785494@qq.com
 */
@RestController
@RequestMapping("/user")
@RefreshScope
public class UserController {

    @Value("${server.port}")
    private String port;

    @Value("${test.name}")
    private String name;

    @GetMapping("/{id}")
    public User findByid(@PathVariable("id") Long id) {
        return new User(id, "Avalon", "我太难了" + name);
    }
}
